import { createRequest } from '@/request'
import { formData } from '@/request/common'

// 新增
export const learningSave = data => {
  return createRequest({
    url: `/teacher/learning/save`,
    method: 'post',
		data
  })
}

// 编辑
export const learningModify = data => {
  return createRequest({
    url: `/teacher/learning/modify`,
    method: 'post',
		data
  })
}

// 查看详情
export const learningFindById = data => {
  return createRequest({
    url: `/teacher/learning/findById/${data.id}`,
    method: 'get',
		params: data
  })
}

// 删除
export const learningDelete = data => {
  return createRequest({
    url: `/teacher/learning/delete`,
    method: 'delete',
		data
  })
}

// 上线
export const learningOnline = data => {
  return createRequest({
    url: `/teacher/learning/online/${data.id}`,
    method: 'post',
		data
  })
}

// 下线
export const learningOffline = data => {
  return createRequest({
    url: `/teacher/learning/offline/${data.id}`,
    method: 'post',
		data
  })
}

// 分页
export const learningPage = data => {
  return createRequest({
    url: `/teacher/learning/page`,
    method: 'get',
		params: data
  })
}


